import instance from '@/services/axios'


export function getProList(count = 1) {
    return instance({
        url: '/pro/list',
        method: 'GET',
        params: { count }
    })
}

export function getLogin(data) {
    return instance({
        url: '/user/login',
        method: 'POST',
        data
    })
}

export function getCatList() {
    return instance({
        url: '/pro/categorylist',
        method: 'GET',
    })
}

export function getKillList() {
    return instance({
        url: '/pro/seckilllist',
        method: 'GET',
    })
}

export function getDetail(proid) {
    return instance({
        url: '/pro/detail/' + proid,
        method: 'GET',
    })
}

export function getHotList() {
    return instance({
        url: '/pro/hotword',
        method: 'GET',
    })
}

export function getCarAdd(data) {
    return instance({
        url: '/cart/add',
        method: 'POST',
        data
    })
}


export function getUserInfo(userid) {
    return instance({
        url: '/user/info',
        method: 'GET',
        params: { userid }
    })
}


export function getCarList(data) {
    return instance({
        url: 'cart/list',
        method: 'POST',
        data
    })
}

export function checkTel(data) {
    return instance({
        url: 'user/docheckphone',
        method: 'POST',
        data
    })
}


export function getCode(data) {
    return instance({
        url: '/user/dosendmsgcode',
        method: 'POST',
        data
    })
}

export function checkCode(data) {
    return instance({
        url: '/user/docheckcode',
        method: 'POST',
        data
    })
}

export function goZhuCe(data) {
    return instance({
        url: '/user/dofinishregister',
        method: 'POST',
        data
    })
}


export function getSeaList(keyword) {
    return instance({
        url: '/pro/search',
        method: 'GET',
        params: { keyword }
    })
}

export function upDataCar(data) {
    return instance({
        url: '/cart/updatenum',
        method: 'POST',
        data
    })
}

export function selectCar(data) {
    return instance({
        url: '/cart/selectone',
        method: 'POST',
        data
    })
}

export function selectCarAll(data) {
    return instance({
        url: '/cart/selectall',
        method: 'POST',
        data
    })
}

export function removeCar(data) {
    return instance({
        url: '/cart/remove',
        method: 'POST',
        data
    })
}
